<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-form ref="form" :rules="rules" label-width="100px" id="mvcfm">
      <div class="form-unit">
        <span class="mvc-title-left"> 发布文件任务 </span>
      </div>
      <div>
        <el-row>
          <el-col :span="12">
            <el-form-item label="任务类型" prop="">
              <el-select style='width:100%' v-model="empty">
                <el-option label="1级类型" value="1级类型" />
                <el-option label="2级类型" value="2级类型" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="任务标题" prop="">
              <el-input v-model="empty" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="关键字" prop="">
              <el-input v-model="empty" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="简介" prop="">
              <Editor v-model="empty" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="编写人" prop="">
              {{empty}}
              <el-button @click="popChoicePersonPro('','')" type="success" size="mini"><i class="fa fa-edit"></i>选择</el-button>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="完成时间" prop="">
              <el-date-picker v-model="empty" type="date" style='width:100%' value-format="yyyy-MM-dd" />
            </el-form-item>
          </el-col>
        </el-row>
      </div>
      <el-button @click="issueDocumentSubmit('')" type='success' size="mini"><i class='fa fa-check'></i>发布</el-button>
      <el-button @click="gotoPage('/psi/product/DocumentReview?'+vueparams+'')" type='primary' size="mini"><i class='fa fa-reply'></i>返回</el-button>
    </el-form>
    <el-dialog :visible.sync="ChoicePersonProVisible" append-to-body>
      <ChoicePersonPro v-if="ChoicePersonProVisible" ref="ChoicePersonPro" :popparams="popparams"> </ChoicePersonPro>
    </el-dialog>
  </div>
</template>
<script>
  import request from '@/utils/request'
  import ChoicePersonPro from "@/views/psi/produce/ChoicePersonPro";
  export default {
    name: 'IssueDocument',
    components: {
      ChoicePersonPro,
    },
    props: ['popparams'],
    data() {
      return {
        ChoicePersonProVisible: false,
        ChoicePersonProValue: null,
        ChoicePersonProDesc: null,
        vueparams: this.getVUEParams(""),
        loading: false,
        rules: {}
      }
    },
    created() {},
    updated() {},
    mounted() {},
    methods: {
      issueDocumentSubmit(_params) {
        this.$refs["form"].validate(valid => {
          if (valid) {
            request({
              method: 'post',
              url: '/xcapi/VUEAction/psi/produce/IssueDocument/issueDocumentSubmit?' + _params + this.vueparams,
              data: this.postData()
            }).then(data => {
              this.gotoPage("/psi/main/VUE0C907B956B6A427083A9CF3C63B5D9FB?" + this.vueparams, data);
              this.msgSuccess(data.msg);
            })
          } else {
            this.msgError("必填项错误");
          }
        });
      },
      popChoicePersonPro(desc, value) {
        this.ChoicePersonProVisible = true;
        this.ChoicePersonProDesc = desc;
        this.ChoicePersonProValue = value;
      },
    },
  }
</script>
